package ee122Networking;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Router {

	protected static List<byte[]> internalStorage = Collections.synchronizedList(new ArrayList<byte[]>());
	protected static List<byte[]> priorityStorage = Collections.synchronizedList(new ArrayList<byte[]>());

	public static void main(String [ ] args)
	{
		RouterReceiverThread rt;
		RouterSenderThread st;
		boolean priority = true;
		int priorityDestination = 4500;

		if (priority) {
			rt = new RouterReceiverThread(internalStorage, priorityStorage, priorityDestination);
			st = new RouterSenderThread(internalStorage, priorityStorage);
		} else {
			rt = new RouterReceiverThread(internalStorage);
			st = new RouterSenderThread(internalStorage);
		}
		rt.start();
		st.start();
	}
	
}
